package com.example.administrator.yuejian35.Recommend.model;

import com.example.administrator.yuejian35.Recommend.interf.RecommendService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.example.administrator.yuejian35.Config.BASE_URL;

/**
 * Created by HP on 2017/9/30.
 */

public class RecommendModel {
    private Retrofit retrofit;
    public RecommendModel(){
        retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call getallcourses(){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.getallcourses();
    }

    public Call getcainiaocourses(){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.getcainiaocourses();
    }

    public Call getrumencourses(){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.getrumencourses();
    }

    public Call getjinjiecourses(){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.getjinjiecourses();
    }

    public Call getcourse(String courseid){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.getcourse(courseid);
    }

    public Call searchcourse(String coursename){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.searchcourse(coursename);
    }

    public Call applycourse(String courseid, String userid, String num, String tel){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.applycourse(courseid,userid,num,tel);
    }

    public Call showapply(String userid){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.showapply(userid);
    }
    public Call showapplyinfo(String courseapplyid){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.showapplyinfo(courseapplyid);
    }
    public Call showguanzhu(String userid){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.showguanzhu(userid);
    }

    public Call cancleguanzhu(String cmid){
        RecommendService recommendService = retrofit.create(RecommendService.class);
        return recommendService.cancleguanzhu(cmid);
    }

}
